package com.sy.service.impl;

import com.sy.service.IpService;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;

/**
 * @author songyi
 * @className IpServiceImpl
 * @description TODO
 * @date 2020/8/14 0014 15:18
 */
@DubboService(group = "dubbo")
public class IpServiceImpl implements IpService {

    @Override
    public String getIp() {
        String ip = RpcContext.getContext().getAttachment("ip");
        System.out.println("获取消费者IP：" + ip);
        return "调用提供者2，返回结果为：" + ip;
    }
}
